package com.example.guava;

import com.google.common.util.concurrent.RateLimiter;

public class RateLimterMain {

    public static void main(String[] args) {
        RateLimiter rateLimiter = RateLimiter.create(2);
        int i=0;

        while (i++<2){
            int finalI = i;
            new Thread(() -> {
                double acquire = rateLimiter.acquire();
                System.out.println(finalI+":"+acquire);
            }).start();
        }

    }

}
